<?php
/**
 * News Feeds
 * Every events,tasks that are relative to the contact
 *
 * @package contact
 */
use Shama\Contact\Task;
use Shama\Messages;
use Fox\Html\Button;
use Fox\Generator;
use Hive\Mission;
use Fox\Html\Stream\News;
use Fox\Html\Stream;

/* @var $contact Shama\Contact */
$contact = Xview::instance()->component("contacts", "contact");
$data = $contact->getData();
$feeds = $contact->feeder();
$stream = new Stream('stream');
foreach($feeds as $timestamp => $item)
{
	$object = $item['object'];
	$titleClass = null;
	switch ($item['type'])
	{
		case Task::className():
			$whisheDate = new DateTime($object->cdate);
			$date = Msg(Hive::BUNDLE,Hive::MSG_NEW_DATE,
						$whisheDate->format('d'),
						Fox\Ddic\DataElement\Text::label('month',$whisheDate->format('m')),
						$whisheDate->format('Y'));

			/* @var $object \Shama\Tasks */
	//	$title = Msg(Messages::BUNDLE_NAME,,$date,);
			$content = $object->comment;
			$titleClass = 'whishe';
		break;
	}
//	$stream->add(new News($item['type'].$object->getId(),$title,$content))
//				->titleClass($titleClass);
}
//$change = new Button("change",Generator::display("change",Generator::url("contacts","detail","update",array("inLineId" => $contact->getId()))));
?>
<div class="contentArea">
	<div>
		<div class="contactDetailBanner">
			<?php echo Xview::instance()->display(Generator::url("contacts","detail","contact")); ?>
		</div>
	</div>
	<div class="streamWrapper">
		<?php echo $stream->render(); ?>
	</div>
</div>